package field

import "gitee.com/yanwc/net/utils"

type (
	CommandWord    U1    // 消息头命令字(类别)
	CommandWordRaw U1Raw // 消息头命令字(类别)
)

func (cw CommandWord) Raw() (out CommandWordRaw) {
	copy(out[:], utils.NumberToBytesWithBigEndian(cw))
	return
}

func (cw CommandWordRaw) Type() CommandWord {
	return utils.BytesToNumber[CommandWord](cw[:])
}

func (cw CommandWordRaw) Slice() []byte {
	return cw[:]
}
